Debian 6.0
Sponsored Link

Configure NIS Server
2011/03/08
  Configure NIS server in order to share users' accounts.

[1] Install NIS system
root@dlp:~#
aptitude -y install nis portmap


Preconfiguring packages ...

# input domain name

# Autostart NIS in installation will be fail because configuration is none yet, so wait for a moment to finish it.


[2] Configure NIS Server
root@dlp:~#
vi /etc/default/nis


# line 6: change (set NIS master server)

NISSERVER=
master


root@dlp:~#
vi /etc/ypserv.securenets


# This line gives access to everybody. PLEASE ADJUST!
# make it comment

#
0.0.0.0 0.0.0.0

# add at the last: IP address you allow

255.255.255.0
10.0.0.0


root@dlp:~#
vi /var/yp/Makefile


# line 119: add

ALL = passwd
shadow
group hosts rpc services netid protocols netgrp

root@dlp:~#
vi /etc/hosts


127.0.0.1
localhost

127.0.1.1
dlp.srv.world   dlp

# add own IP address for NIS database

10.0.0.30
dlp.srv.world   dlp


root@dlp:~#
/usr/lib/yp/ypinit -m
# update NIS database


At this point, we have to construct a list of the hosts which will run NIS
servers. master is in the list of NIS server hosts. Please continue to add
the names for the other hosts, one per line. When you are done with the
list, type a <control D>
.     next host to add: dlp
    next host to add:
# push Ctrl+D

The current list of NIS servers looks like this:

dlp

Is this correct? [y/n: y]
y

We need a few minutes to build the databases...
Building /var/yp/srv.world/ypservers...
gethostbyname(): Success
Running /var/yp/Makefile...
make[1]: Entering directory `/var/yp/srv.world'
Updating passwd.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating passwd.byuid...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating group.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating group.bygid...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating shadow.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating hosts.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating hosts.byaddr...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating rpc.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating rpc.bynumber...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating services.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating services.byservicename...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating netid.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating protocols.bynumber...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating protocols.byname...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating netgroup...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating netgroup.byhost...
failed to send 'clear' to local ypserv: RPC: Program not registeredUpdating netgroup.byuser...
failed to send 'clear' to local ypserv: RPC: Program not registeredmake[1]: Leaving directory `/var/yp/srv.world'

master has been set up as a NIS master server.

Now you can run ypinit -s master on all slave server.

root@dlp:~#
/etc/init.d/nis start

Starting NIS services: ypserv yppasswdd ypxfrd ypbind.

# It's neccessary to update NIS database with following way if new user is added again

root@dlp:~#
cd /var/yp

root@dlp:/var/yp#
 
Tweet